﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Triunfadores.BusinessEntities;

namespace Triunfadores.Repository.Mapping
{
    public class UbigeoMap : EntityTypeConfiguration<Ubigeo>
    {
        public UbigeoMap()
        {
            //clave primaria y que sea autoincremental
            this.HasKey(tc => tc.Id);
            this.Property(tc => tc.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            //propiedades
            this.Property(tc => tc.Nombre)
                .HasColumnType("varchar")
                .HasMaxLength(50)
                .IsRequired();
            this.Property(tc => tc.NombreCompleto)
                .HasColumnType("varchar")
                .HasMaxLength(150)
                .IsRequired();
        }
    }
}
